package crm.view.setting.addremovelist;

import java.awt.Color;
import java.awt.Component;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JLabel;
import javax.swing.JList;

import crm.model.teacherPC.bannedList.Bann;

public class EnableListRenderer extends DefaultListCellRenderer {
	
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		
		JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
		if (((Bann)value).getEnable()){
			label.setBackground(Color.GREEN);
		}
		return label;
	}
}